import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../views/Home.vue'
import SignUp from '../views/SignUp.vue'
import Login from '../views/Login.vue'
import Blog from '../views/Blog.vue'
const routes = [
  {
    path: '/',
    name: '首页',
    component: Home,
    children:[
      {
        path: '/',
        name: 'Blog',
        component: Blog
      },
    ]
  },
  {
    path: '/',
    component: Home,
    children:[
      {path: '/blog_add', name: 'blogAdd', component: () => import('../views/blog/BlogAdd.vue'),},
      {path: '/blog_detail', name: 'blogDetail', component: () => import('../views/blog/BlogDetail.vue'),},
      {path: '/attention', name: 'attention', component: () => import('../views/attention/Attention'),},
      {path: '/user_center', name: 'userCenter', component: () => import('../views/user/UserCenter'),},
    ]
  },
  {
    path: '/sign_up',
    name: '注册',
    component: SignUp,
  },
  {
    path: '/login',
    name: '登录',
    component: Login,
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
